package jdk;

import org.apache.commons.lang3.RandomUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * @Author: Yangu
 * @Created time: 2021/1/6 17:50
 * @Description :
 */
public class Student extends Person{

    private String name;

    private Integer age;

    public Student(String sex) {
        super(sex);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

   /* @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(name, student.name) &&
                Objects.equals(age, student.age);
    }*/

    /*@Override
    public int hashCode() {
        return RandomUtils.nextInt(1, 20);
//        return Objects.hash(name, age);
    }*/

    public static void main(String[] args) {
//        Student student1 = new Student("man");
//        student1.setAge(1);
//        student1.setName("aaa");
//        Student student2 = new Student("man");
//        student2.setAge(1);
//        student2.setName("aaa");
//        System.out.println(student1.equals(student2));
//        System.out.println(student1.hashCode());
//        System.out.println(student2.hashCode());
//        Integer h = 123456;
//        System.out.println((h = h.hashCode()) ^ (h >>> 16));

        System.out.println(8 ^ 9);
        System.out.println(32 & 15);

        Map<Integer, String> map = new HashMap<>();
//        map.put(1,"String");
//        map.put(32+1,"String");
//        map.put(64+1,"String");
//        map.put(128+1,"String");
//        map.put(256+1,"String");
        map.put(0,"String");
        map.put(32,"String");
        map.put(64,"String");
        map.put(128,"String");
        map.put(256,"String");
        map.put(256<<1,"String");
        map.put(256<<2,"String");
        map.put(256<<3,"String");
        map.put(256<<4,"String");
        map.put(256<<5,"String");
        map.put(256<<6,"String");
        map.put(256<<7,"String");
        System.out.println(map.size());
    }
}
